package lucene.index
{
	import mx.utils.StringUtil;
	
	public class Term
	{
		
		public var field:String;
		public var text:String;
		
		public function Term(text:String, field:String)
		{
			this.field = field;
			this.text = text;
		}
		
		/**
		 * retrive a key for the term
		 */ 
		public function key():String
		{
			var sep:String = "_";//String.fromCharCode(0);
			var key:String = this.field.concat(sep, this.text); 
			return key;
		}
		
		public static function getPrefix(str:String, len:Number):String
		{
			return str.substr(0, len);	
		}

	}
}